package test;

public class TicketCounter {
    private int tickets = 100;
    public synchronized void sellTicket(){
        if (tickets>0) {
            System.out.println(Thread.currentThread().getName() + "卖出票：" + tickets);
            tickets--;
        }
    }
}
